package app;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {	
		DataSet dataSet = DataSetReader.read("cheat.cds");
		dataSet.setImpurityMeasure(ImpurityMeasure.Gini);
		
		DecisionTree decisionTree = new DecisionTree(dataSet);
		decisionTree.printTree();
		
//		readFromConsole();
	}

	public static void readFromConsole() {
		Scanner input = new Scanner(System.in);
		String fileName, impurityMeasure;

		System.out.print("Introduceti numele fisierului: ");
		fileName = input.nextLine();

		DataSet dataSet = DataSetReader.read(fileName + ".cds");
		
		System.out.print("Introduceti masura de impuritate (Gini / Entropy): ");
		impurityMeasure = input.nextLine();
		input.close();

		if (impurityMeasure.equalsIgnoreCase("Gini")) {
			dataSet.setImpurityMeasure(ImpurityMeasure.Gini);
		} else if (impurityMeasure.equalsIgnoreCase("Entropy")) {
			dataSet.setImpurityMeasure(ImpurityMeasure.Entropy);
		}

		DecisionTree decisionTree = new DecisionTree(dataSet);
		decisionTree.printTree();
	}
}